// 函数类型接口
interface encrypt {
    (key: string, value: string): string;
}

let md5: encrypt = (key: string, val:string) => {
    return key + val
}

// 可索引接口 对数组的约束
interface userArr {
    [index: number]: string
}

let arr:userArr = ['1', '2']

// 可索引接口 对对象的约束
interface userObj {
    [index: string]: string
}

let obj:userObj = {name: 'zhangsan'}

// 类类型接口
interface Animal {
    name: string;
    eat(str: string): void
}

class Dog implements Animal {
    name: string;

    constructor(name: string) {
        this.name = name
    }

    eat(str: string): void {
    }
}

export {}